Skip to content

[glass] Runtime config for RepoMapping - #565

Closed
simonmar wants to merge 1 commit into
facebookincubator:mainfrom
simonmar:repomapping
Closed

[glass] Runtime config for RepoMapping#565
simonmar wants to merge 1 commit into
facebookincubator:mainfrom
simonmar:repomapping

Conversation

@simonmar

Copy link
Copy Markdown
Collaborator

Right now with the open source build it's impossible to use Glass, because RepoMapping is fixed at compile-time. This moves it into a runtime config.

Tested with the following in ~/.config/glean/glass/repomapping:

{
  "indices": {
    "stackage": [
      {
        "name": "stackage",
        "language": "hs"
      }
    ],
    "haxl": [
      {
        "name": "haxl",
        "language": "hs"
      }
    ]
  }
}

It defaults to an empty repomapping if one isn't provided. We'll probably need to fix up the react demo.

@netlify

netlify Bot commented Jul 15, 2025

Copy link
Copy Markdown

Deploy Preview for fb-oss-glean canceled.

Name Link
🔨 Latest commit 3d46781
🔍 Latest deploy log https://app.netlify.com/projects/fb-oss-glean/deploys/687652b0eec197000815cd9e

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 15, 2025
@simonmar
simonmar marked this pull request as ready for review July 15, 2025 13:53
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@pepeiborra has imported this pull request. If you are a Meta employee, you can view this in D78405379.

@pepeiborra

Copy link
Copy Markdown
Contributor

This is a bit tricky to merge, so I am wondering how useful it is.

For most open source users, is a repo mapping needed? Presumably there is only one repo, and therefore all the DBs are applicable.

@simonmar

Copy link
Copy Markdown
Collaborator Author

@pepeiborra this doesn't actually work as intended, I'm putting it back in draft for now.

This is a bit tricky to merge, so I am wondering how useful it is.

For most open source users, is a repo mapping needed? Presumably there is only one repo, and therefore all the DBs are applicable.

I suppose we could assume a 1:1 mapping between RepoName and GleanDB, is that what you had in mind?

@simonmar
simonmar marked this pull request as draft July 16, 2025 13:25
@simonmar

Copy link
Copy Markdown
Collaborator Author

@pepeiborra I thought you might want to do this internally though, it was always a pain to have to redeploy Glass just to change the RepoMapping.

@pepeiborra

Copy link
Copy Markdown
Contributor

Yeah, it's bound to happen at some poitn

@pepeiborra

pepeiborra commented Jul 16, 2025

Copy link
Copy Markdown
Contributor

@pepeiborra this doesn't actually work as intended, I'm putting it back in draft for now.

This is a bit tricky to merge, so I am wondering how useful it is.
For most open source users, is a repo mapping needed? Presumably there is only one repo, and therefore all the DBs are applicable.

I suppose we could assume a 1:1 mapping between RepoName and GleanDB, is that what you had in mind?

I had something simpler in mind, just give Glass a DB name or names at startup, or even allow it to check all the DBs in the store

@simonmar

Copy link
Copy Markdown
Collaborator Author

@pepeiborra see what you think of #566

That's sufficient for open source, I can return to the runtime config later if necessary.

@simonmar simonmar closed this Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants